using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

using System.Drawing;

namespace ClientGUI
{
    /// <summary>
    /// Superclass of all list-style tags.  Allows for them to display a fixed 
    /// sized "bullet" on the left.
    /// Also serves as the implementer for a bulleted list.
    /// </summary>
    class ListSquare : SimpleSquare
    {
        public ListSquare(XmlNode doc, Module parent,
            DisplayDocument host, XmlNode config, TagConfig tagconfig)
            :
            base(doc, parent, host, config, tagconfig)
        {
            my_top_buffer = 0;
            my_bottom_buffer = 3;
            my_left_buffer = 15;
            my_right_buffer = 3;
        }

        /// <summary>
        /// The width you need for the bullet.
        /// Makes a square area, so this affects height too!
        /// </summary>
        /// <returns></returns>
        public virtual int BulletWidth()
        {
            return 15;
        }

        /// <summary>
        /// Needs an area of BulletWidth wide and high
        /// </summary>
        /// <param name="g">Graphics context</param>
        /// <param name="point">Offset to draw point to</param>
        /// <param name="color">Color of bullet</param>
        /// <param name="child">Child of this list item?</param>
        public virtual void DrawBullet(Graphics g, Point point, Color color, Module child)
        {
            g.FillEllipse(new SolidBrush(color), new Rectangle(point.X+3, point.Y+3, BulletWidth()-6,
                                                                    BulletWidth()-6));
        }
    }
}
